# Maintainer: Drew DeVault <sir@cmpwn.com>
pkgname=gmnisrv
pkgver=1.0
pkgrel=0
pkgdesc="simple Gemini protocol server"
url="gemini://drewdevault.com/gmnisrv.gmi"
arch="all"
license="GPL-3.0-only"
source="
	$pkgname-$pkgver.tar.gz::https://git.sr.ht/~sircmpwn/gmnisrv/archive/$pkgver.tar.gz
	gmnisrv.confd
	gmnisrv.initd
"
install="$pkgname.pre-install"
subpackages="$pkgname-doc $pkgname-openrc"
depends="mailcap"
makedepends="scdoc openssl1.1-compat-dev"
options="!check" # no upstream tests

build() {
	./configure
	make PREFIX=/usr
}

package() {
	make PREFIX=/usr DESTDIR="$pkgdir" install
	install -Dm644 config.ini \
		"$pkgdir"/etc/gmnisrv.ini
	install -Dm644 "$srcdir"/gmnisrv.confd \
		"$pkgdir"/etc/conf.d/gmnisrv
	install -Dm755 "$srcdir"/gmnisrv.initd \
		"$pkgdir"/etc/init.d/gmnisrv
}

sha512sums="
90ec9fdb2258a9b728d0eeebfaf5a6ca428321a9f54b865a762e979cc7c67c1eb414f5f02f8fe4e90f6aa4d2fd954712e63d33348629e05af20356fc4cefaabe  gmnisrv-1.0.tar.gz
b11ec0422f495e8071bbcf9d5e5088b452dfbfe0b95ae7af6ee749fe70063460753d1bef81f2d957043035ea9fe41a59a99da0ad07199783993b896549512806  gmnisrv.confd
b48895b478679b0239a261b8b075b942204cd15616dadebe93d05c423c388caa9deced8f50c1d44e51442cc850c48a5e5b3863ff8e2ae7beb8911276a36c847e  gmnisrv.initd
"
